﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace XRM.Security.DataAccess.Models
{
    [Table("Department")]
    public class Department
    {
        public Department()
        {
            DepartmentAddresses = new List<DepartmentAddress>();
        }

        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int DepartmentId { get; set; }

        [Required]
        [MaxLength(250)]
        public string Name { get; set; }

        [Required]
        public bool IsDeleted { get; set; }

        public virtual ICollection<DepartmentAddress> DepartmentAddresses { get; set; }
        public virtual ICollection<UserRegister> Users { get; set; }
        public virtual ICollection<RequestWorkKindParam> RequestParams { get; set; }
    }
}
